using System;
using System.Collections.Generic;
namespace MicroMsg.UI.Page
{
	internal class CityDataSource : LoopingDataSourceBase
	{
		private List<AreaItem> citys;
		public CityDataSource(List<AreaItem> citys)
		{
			this.citys = citys;
			base.SelectedItem = citys.get_Item(0);
		}
		public override object GetNext(object relativeTo)
		{
			if (relativeTo == null)
			{
				return null;
			}
			int index = ((AreaItem)relativeTo).index;
			if (index > this.citys.get_Count() - 2)
			{
				return null;
			}
			return this.citys.get_Item(index + 1);
		}
		public override object GetPrevious(object relativeTo)
		{
			if (relativeTo == null)
			{
				return null;
			}
			int index = ((AreaItem)relativeTo).index;
			if (index < 1)
			{
				return null;
			}
			return this.citys.get_Item(index - 1);
		}
	}
}
